
package com.ds.hsql;

import com.ds.common.cache.Cache;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @author wenzhang
 *
 */
public class HsqlDbCacheFactory {
    public static Cache createCache(String name, int maxCacheSize, long maxLifetime, HsqlDbServer db) {
        Cache cache = (Cache)caches.get(name);
        if (cache != null)
            return cache;
        else {
            cache = new HsqlDbCache(name, maxCacheSize, maxLifetime, db);
            caches.put(name, cache);
        }

        return cache;
    }

    private static Map caches = new HashMap();
}
